package com.winning.xffw.service.controller;

import com.winning.xffw.service.entity.dto.BduKafkaMsg;
import com.winning.xffw.service.service.IBduKafkaMsgService;
import com.winning.xffw.service.service.IDataLoadService;
import com.winning.xffw.service.service.ITestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: yanxf@winning.com.cn
 * @Description:
 * @Date 2019/05/15 10:44
 */
@Slf4j
@RestController
public class TestController {


    @Autowired
    private IDataLoadService dataLoadService;

    @Autowired
    private ITestService testService;
    @Autowired
    private IBduKafkaMsgService bduKafkaMsgService;


    @ResponseBody
    @RequestMapping("/saveKafkaMsg")
    public String dataLoad(BduKafkaMsg msg) {
        bduKafkaMsgService.saveKafkaMsg(msg);
        return "保存成功!";
    }

    /**
     * 测试gp的copyIn
     *
     * @return
     */
    @RequestMapping("/copyCsvDataTest")
    @ResponseBody
    public String copyCsvDataTest() {
        testService.copyCsvDataTest();
        return "成功！";
    }


    @RequestMapping("/dumpTableDataTest")
    @ResponseBody
    public String dumpTableData() {
        dataLoadService.dumpTableData();
        return "处理成功！";
    }

}